//
//  BodyCheckCheckResultListCell.m
//  TryShopping
//
//  Created by panquanReabam.com on 16/9/8.
//  Copyright © 2016年 RuiBen. All rights reserved.
//

#import "BodyCheckCheckResultListCell.h"

@interface BodyCheckCheckResultListCell()

@property(nonatomic,strong)UILabel *reportNo;
@property(nonatomic,strong)UILabel *serialNumber;
@property(nonatomic,strong)UILabel *reportDate;
@property(nonatomic,strong)UILabel *reportDateName;
@property(nonatomic,strong)UILabel *companyName;
@property(nonatomic,strong)UILabel *address;

@property(nonatomic,strong)UILabel *lineLabel;
@end
@implementation BodyCheckCheckResultListCell

- (void)awakeFromNib {
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createView];
        [self setViewAutoLayout];

        
    }
    
    return self;
    
}
-(void)createView
{
    self.serialNumber=[[UILabel alloc] init];
    self.serialNumber.font= [UIFont systemFontOfSize:13];
    self.serialNumber.text=@"编号 ";
    self.serialNumber.textAlignment=NSTextAlignmentCenter;
    [self.serialNumber.layer setCornerRadius:2];
    [self.serialNumber.layer setBorderWidth:0.5];
    CGColorSpaceRef tureBTnSpace = CGColorSpaceCreateDeviceRGB();
    CGColorRef tureBTncolorref = CGColorCreate(tureBTnSpace,(CGFloat[]){228/255.0, 228/255.0, 228/255.0, 1.0});
    [self.serialNumber.layer setBorderColor:tureBTncolorref];//边框颜色
    self.serialNumber.textColor=[UIColor whiteColor];
    self.serialNumber.backgroundColor=luseColor;
    self.serialNumber.layer.masksToBounds = YES;
    [self addSubview:self.serialNumber];

    self.reportNo=[[UILabel alloc] init];
    self.reportNo.font= [UIFont systemFontOfSize:16];
    self.reportNo.textColor=[UIColor colorWithRed:51/255.0f green:51/255.0f blue:51/255.0f alpha:1.0];
    [self addSubview:self.reportNo];
   
   
    self.reportDateName=[[UILabel alloc] init];
    self.reportDateName.font= [UIFont systemFontOfSize:14];
    self.reportDateName.text=@"检测时间";
    self.reportDateName.textColor=zhonghuiColor;
    [self addSubview:self.reportDateName];
    self.reportDate=[[UILabel alloc] init];
    self.reportDate.font= [UIFont systemFontOfSize:14];
    self.reportDate.textColor=shenhuiColor;
    [self addSubview:self.reportDate];
    self.address=[[UILabel alloc] init];
    self.address.font= [UIFont systemFontOfSize:14];
    self.address.text=@"检测地点";
    self.address.textColor=zhonghuiColor;
    [self addSubview:self.address];
    
    self.companyName=[[UILabel alloc] init];
    self.companyName.font= [UIFont systemFontOfSize:14];
    self.companyName.textColor=shenhuiColor;
    [self addSubview:self.companyName];

    
    
    self.lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(10, 99.5, ScreenWidth-20, 0.45)];
    [self.lineLabel setBackgroundColor:[UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f]];
    self.lineLabel.textColor=[UIColor clearColor];
    [self addSubview:self.lineLabel];
    
    UIButton*renzhenButton=[[UIButton alloc]init];
    renzhenButton.frame=CGRectMake(ScreenWidth-45, 50-17, 33, 33);
    [renzhenButton setImage:[UIImage imageNamed:@"shouqi"] forState:UIControlStateNormal];
    renzhenButton.userInteractionEnabled=NO;
    [self addSubview:renzhenButton];

    
}

-(void)setModel:(BodyCheckCheckResultListModel *)model{
    
    
    
    self.reportNo.text=[NSString stringWithFormat:@"%@",model.reportNo];
    self.reportDate.text=[NSString stringWithFormat:@"%@",model.reportDate];
    self.companyName.text=[NSString stringWithFormat:@"%@",model.companyName];
    

}
-(void)setViewAutoLayout
{
    
    [self.serialNumber mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@15);
        make.top.equalTo(self.mas_top).with.offset(20);
    }];
    [self.reportNo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.serialNumber.mas_right).with.offset(5);
       
        make.centerY.equalTo(self.serialNumber.mas_centerY) ;
    }];
    
    [self.reportDateName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.top.equalTo(self.mas_top).with.offset(50);
    }];
    
    [self.reportDate mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.reportDateName.mas_right).with.offset(5);
        make.centerY.equalTo(self.reportDateName.mas_centerY) ;
    }];
    
    [self.address mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.top.equalTo(self.mas_top).with.offset(67);
    }];
    [self.companyName mas_makeConstraints:^(MASConstraintMaker *make) {
      make.left.equalTo(self.address.mas_right).with.offset(5);
        make.centerY.equalTo(self.address.mas_centerY) ;
    }];
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}


@end
